package com.bluestation.net.ftp;

import java.io.Serializable;

public class FtpClient implements Serializable {
	private static final long serialVersionUID = 1L;
	
	private final class Observer{
		@SuppressWarnings("unused")
		private FtpClient parent = null;
		private String svrIP = "127.0.0.1";
		private int port = 21;		
		private String userID = "anonymouse";
		private String userPWD = "you@home.com";		
		private FtpAccessMode accessMode = FtpAccessMode.PASSIVE;
		private FtpTransType transType = FtpTransType.BINARY;
		private FtpTransMode transMode = FtpTransMode.STREAM;		
		private boolean isConnected = false;
		private boolean isLogIn = false;
		
		public Observer( FtpClient parent )
		{
			this.parent = parent;
			Init();
		}
		private void Init(){
			this.svrIP = "127.0.0.1";
			port = 21;
			userID = "anonymouse";
			userPWD ="you@home.com";			
			accessMode = FtpAccessMode.PASSIVE;
			transType = FtpTransType.BINARY;
			transMode = FtpTransMode.STREAM;
			isConnected = false;
			isLogIn = false;
		}
		public String getRemoteIP(){
			return this.svrIP;
		}
		public int getRemotePort(){
			return this.port;
		}
		public String getUserID(){
			return this.userID;
		}
		public String getUserPWD(){
			return this.userPWD;
		}
		public FtpAccessMode getAccessMode(){
			return this.accessMode;
		}
		public void setAccessMode( FtpAccessMode val ){
			this.accessMode = (val == null ? FtpAccessMode.PASSIVE : val);
		}
		public FtpTransType getTransType(){
			return this.transType;
		}
		public void setTransType( FtpTransType val ){
			this.transType = ( val == null ? FtpTransType.BINARY : val);
		}
		public FtpTransMode getTransMode(){
			return this.transMode;
		}
		public void setTransMode( FtpTransMode val ){
			this.transMode = ( val == null ? FtpTransMode.STREAM : val);
		}
		public boolean getIsConnected(){
			return isConnected;
		}
		public boolean getIsLoggin(){
			return this.isLogIn;
		}
	} // end of Observer Class
	
	
	private Observer ob = null;
	public FtpClient()
	{
		Init();
	}
	
	private void Init()
	{
		ob = new Observer( this );
	}	
	protected void SendCommand( FtpCommand cmd )
	{	
	}
	public boolean Connect()
	{
		return false;
	}
	public void Noop()
	{
	}
	
	public FtpAccessMode getAccessMode(){
		return ob.getAccessMode();
	}
	public void setAccessMode( FtpAccessMode val ){
		ob.setAccessMode(val);
	}
}
